package com.lzh.seatrend.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @Classname Date
 * @Description TODO
 * @Date 2021/12/30 13:10
 * @Created by liuzihao
 */
public class DateTest {
    public static void main(String[] args) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String date = "2021-12-28 00:00:00";
        Date date1 = null;
        try {
            date1 = format.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date1);
        calendar.add(Calendar.MINUTE,5);
        Date time = calendar.getTime();
        System.out.println(time);
        String timeStr = format.format(time);
        System.out.println(timeStr);
    }
}
